package com.nyist.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.nyist.dao.RelationDAO;
import com.nyist.entity.Relation;
import com.nyist.service.RelationService;

/**
 * 关系的操作
 * @author 18077
 *
 */
@Service("relationService")
public class RelationServiceImpl implements RelationService {
	@Resource
	private RelationDAO relationDao;
	@Override
	public void insertRelation(Relation relation) {
		relationDao.save(relation);	
	}

	@Override
	public int queryRoleByManageid(String manageid) {
		return relationDao.selectRoleIdByManageid(manageid);
		
	}

	public RelationDAO getRelationDao() {
		return relationDao;
	}

	public void setRelationDao(RelationDAO relationDao) {
		this.relationDao = relationDao;
	}

	@Override
	public String queryDiscriptionByManageid(int roleid) {
		
		return relationDao.selectDiscriptionByManageid(roleid);
	}

	@Override
	public String queryRoleByRoleid(int roleid) {
		// TODO Auto-generated method stub
		return relationDao.selectRoleByRoleid(roleid);
	}

	@Override
	public void UpdatePower(String manageid, int roleid) {
		relationDao.updatePower(manageid, roleid);
		
	}
	
	
}
